<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>获取七大洲的大写字母简称</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.geoip-continent-code-by-name" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">geoip_continent_code_by_name</h1>
  <p class="verinfo">(PECL geoip &gt;= 1.0.3)</p><p class="refpurpose"><span class="refname">geoip_continent_code_by_name</span> &mdash; <span class="dc-title">获取七大洲的大写字母简称</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.geoip-continent-code-by-name-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>geoip_continent_code_by_name</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$hostname</code></span>
   ) : <span class="type">string</span></div>


  <p class="para rdfs-comment">
   <span class="function"><strong>geoip_continent_code_by_name()</strong></span> 函数将会返回主机或者IP地址相对应的七大洲大写字母简称。
  </p>

 </div>

 <div class="refsect1 parameters" id="refsect1-function.geoip-continent-code-by-name-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<code class="parameter">hostname</code></dt>

     <dd>

      <p class="para">
       所要定位的主机或IP地址。
      </p>
     </dd>

    
   </dl>

  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.geoip-continent-code-by-name-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功，返回两个大写字母组成的七大洲简称字符串, 如果在数据库中未找到相关信息则返回 <strong><code>FALSE</code></strong> 。
  </p>
  <table class="doctable table">
   <caption><strong>洲代码</strong></caption>
   
    <thead>
     <tr>
      <th>Code</th>
      <th>洲名</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td><em>AF</em></td>
      <td>非洲</td>
     </tr>

     <tr>
      <td><em>AN</em></td>
      <td>南极洲</td>
     </tr>

     <tr>
      <td><em>AS</em></td>
      <td>亚洲</td>
     </tr>

     <tr>
      <td><em>EU</em></td>
      <td>欧洲</td>
     </tr>

     <tr>
      <td><em>NA</em></td>
      <td>北美洲</td>
     </tr>

     <tr>
      <td><em>OC</em></td>
      <td>大洋洲</td>
     </tr>

     <tr>
      <td><em>SA</em></td>
      <td>南美洲</td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.geoip-continent-code-by-name-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-4483">
    <p><strong>Example #1 <span class="function"><strong>geoip_continent_code_by_name()</strong></span> 函数的使用范例：</strong></p>
    <div class="example-contents"><p>
     以下代码将会打印 example.com 的定位信息。
    </p></div>
    <div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$continent&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">geoip_continent_code_by_name</span><span style="color: #007700">(</span><span style="color: #DD0000">'www.example.com'</span><span style="color: #007700">);<br />if&nbsp;(</span><span style="color: #0000BB">$continent</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">'This&nbsp;host&nbsp;is&nbsp;located&nbsp;in:&nbsp;'&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$continent</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
 This host is located in: NA
</pre></div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.geoip-continent-code-by-name-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="geoip_country_code_by_name.html" class="function" rel="rdfs-seeAlso">geoip_country_code_by_name()</a> - 获取国家代码</span></li>
   </ul>
  </p>
 </div>


</div></div></div></body></html>